/*
 * Stars.java
 *
 * This program demonstrates the use of nested loops to
 * display a right angle triangle of stars. 
 *
 
 */

package com.javacore.day3.gamecredit;

/**
 *
 * @author vijayk
 */
public class Stars {
    
    /** Creates a new instance of Stars */
    public Stars() {
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
       
        // Iterate until five rows of stars are dispayed
        for(int i = 0; i < 5;i++){
            
            // Iterate until the number of spaces displayed equals a number 
            // one less than i
            for(int j = 5;j > i;j--)
                System.out.print(" ");
            
            // Iterate until the number of stars displayed equals i
            for(int k = 0; k <= i;k++)
                System.out.print("*");
            
            System.out.println();
        }
        
    }
    
}
